{layout "@projectLayout.latte"}
{block content}
<div id="block_bg">
	<div id="block_left">
		<h1 class="block projectname">{$project['name']} > Dokumenty</h1>
		<div class="block">
			<table class="files">
		{foreach $types as $type}
				<tr class="type"><th colspan="3"><h2>{$type[name]}</h2></th></tr>
				<tr class="header"><th>Název</th><th>Nahrál</th><th></th></tr>
		{foreach $type['files'] as $file}
				<tr class="file info">
					<td>{$file[name]}</td>
					<td>{$file->user[name]} {$file->user[surname]}</td>
					<td class="download" rowspan="2">
						<a n:href="downloadFile, $file[id]">Stáhnout</a>
						<a n:href="deleteFile!, $file[id]" n:if="$user->isAllowed('files','edit') || $user->isAllowed($projectResource,'task_edit')" onclick="return del();"><img src="{$basePath}/images/delete.gif" alt="D" alt="Smazat"></a>
					</td>
				</tr>
				<tr class="file desc"><td colspan="2"><strong>Popis:</strong> {$file[description]}</td></tr>
		{/foreach}
		{/foreach}
			</table>
		</div>
	</div>
	<div id="block_right">
		{include "rightPanel.latte"}
	</div>
	<div class="clear"></div>
</div>
<script type="text/javascript">
function del(){ return confirm("Opravdu chcete soubor smazat?"); }
</script>
{/block}